package main

import (
	"fmt"
	"os"
)

func main_impl(argv []string) int {
	if len(os.Args) == 1 {
		error("Missing parameter, try -h for help")
		return 1
	}

	if argv[1] == "help" {
		return cmd_help(os.Args)
	}

	if argv[1] == "diff" {
		return cmd_diff(os.Args)
	}

	if argv[1] == "gen:csv" {
		return cmd_gen_csv(os.Args)
	}

	if argv[1] == "gen:json" {
		return cmd_gen_json(os.Args)
	}

	if argv[1] == "gen:gmdif" {
		return cmd_gen_gmdif(os.Args)
	}

	error(fmt.Sprintf("Unsupported command `%v'", argv[1]))
	return 2
}

func main() {
	os.Exit(main_impl(os.Args))
}
